home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / pword / pword101 / pword.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-07-08  |  2.4 KB  |  94 lines

  1. Program PWord;
  2. uses dos,crt;
  3.  
  4. const
  5.    {カラーテーブル設定}
  6.    kuro=0;Ao=1;Midori=2;Mizuiro=3;Aka=4;Kiiro=6;Murasaki=5;Shiro=7;
  7.  
  8. var
  9.    jisyo:text;{印刷するファイル名}
  10.    Eng,
  11.    Jap,
  12.    FileLine:string;
  13.  
  14. {==========此処からは関数, 手続きを書く=================================}
  15. function B_pos(locate:integer; key,s:string):integer;
  16. var             {s の locate 文字目から key を探してその番号を帰す}
  17.     Dammy:string[255];
  18. begin
  19.     Dammy:=copy(s,locate,length(s)-locate+1);
  20.     If Pos(key,Dammy)=0 then B_Pos:=0
  21.         else B_Pos:=Pos(key,Dammy)+locate-1;
  22. end;
  23.  
  24. {==メモリーが充分かどうかをチェックするルーチン==ここは既に完成==}
  25. {$f+}
  26. function  HeapFunc(Size: word): integer;
  27. {$f-}
  28. begin
  29.    Writeln(^G+'メモリーが足りません');
  30.    HeapFunc := 1;
  31. end;  { HeapErrorFunc }
  32.  
  33. {=========タイトル表示ルーチン===ここは既に完成==========================}
  34. procedure Title;     {コピーライト表示}
  35. begin
  36.     clrscr;
  37.         TextColor(Shiro);
  38.         Write('      ---- For All FM-Series');
  39.         Writeln(' 英文翻訳支援プログラムシリーズ ----');
  40.     Write('                 --- ');
  41.     TextColor(mizuiro);
  42.     Write('PWORD.EXE Ver.1.01α');
  43.     TextColor(Shiro);
  44.     Writeln(' ---');
  45.     WriteLn('                       Programed by H.Nakayasu (c) 1992');
  46.     TextColor(Shiro);
  47. end;
  48.  
  49. procedure line;
  50. var i:integer;
  51. begin
  52.    textcolor(midori);
  53.    for i:=1 to 80 do
  54.      write('-');
  55.    textcolor(shiro);
  56. end;
  57.  
  58. {===編集ファイルの確認(存在を含めて)====完成================================}
  59. procedure CheckFileExistAndOpenFile;
  60. procedure CheckFileExistAndOpenFileSub;
  61. begin
  62.         Textcolor(aka);
  63.         writeln('<使い方>');
  64.         Textcolor(shiro);
  65.         writeln('PWord [ファイル名]');
  66.         halt(1);
  67. end;
  68. begin
  69.    IF paramcount=0 then CheckFileExistAndOpenFileSub;
  70.    Assign(Jisyo,paramstr(1));
  71.    {$i-}  Reset(Jisyo);  {$i+}
  72.    if IOResult <> 0 then CheckFileExistAndOpenFileSub;
  73. end;
  74.  
  75. begin{メインルーチン}
  76. {===初期の表示=====完成=====================================}
  77.    CheckFileExistAndOpenFile;
  78.    HeapError := @HeapFunc;
  79.    title;
  80.    line;
  81.  
  82. {===一行を辞書ファイルより切り取り、単語と訳を印刷する==完成===============}
  83. while not eof(JIsyo) do
  84. begin
  85.  readln(JIsyo,FileLine);
  86.     Eng:=copy(FileLine,1,B_pos(1,'/',Fileline)-1);
  87.     Jap:=copy(FileLine,B_pos(1,'/',Fileline)+1,Length(FileLine));
  88.     writeln(eng,' ':20-length(eng),jap);
  89. end;
  90.    close(Jisyo);
  91.    textcolor(shiro);
  92.    halt(0);
  93. end.
  94.